using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

[Serializable]
public struct GraphicsColorSwitcherTag
{
    public int mode;
    public Color color;
}

public class YGraphicsColorSwitcher : MonoBehaviour
{
    [SerializeField]
    public List<Graphic> graphics;
    [SerializeField]
    public List<GraphicsColorSwitcherTag> switcherTags;

    public void switchMode(int mode)
    {
        for (int i = 0; i < switcherTags.Count; ++i)
        {
            if (switcherTags[i].mode == mode)
            {
                for (int j = 0; j < graphics.Count; ++j)
                {
                    if (graphics[j] != null)
                    {
                        graphics[j].color = switcherTags[i].color;
                    }
                }
                break;
            }
        }
    }
}
